<p>	Here are your wallets open in the KashFX.com system.</p>

<table id='currentWallets' cellpadding="0" cellspacing="0" class="itemList">
	<thead>
	<tr>
		<th></th>
		<th>Name</th>
		<th>Date Opened</th>
		<th>Currencies</th>
		<th>Balance</th>
		<th class='rightColumn'></th>
	</tr>	
	</thead>
	
	<tbody>
	<?php foreach ($wallets as $key => $val):?>
	<tr>
		<td></td>
		<td>
			<?php echo anchor("user/account/profile/wallet/" . $wallets[$key]['WALLET_CODE'],  $wallets[$key]['NAME']);?>	
		</td>
		<td>
			<?php echo date("d/m/Y", strtotime($wallets[$key]['DATE_OPENED']));?>	
		</td>
		<td>
			<?php 
				$currencies = $wallets[$key]['currencies'];
				$curr_string = "";
				$balance = 0;
				foreach ($currencies as $ckey => $code) {
					$curr_string .= $currencies[$ckey]['C_SYMBOL'] . ",";
				}	
				$curr_string = rtrim($curr_string, ",");
				echo $curr_string;
			?>
		</td>
		<td>
			<?php echo $wallets[$key]["C_SIGN"] . $wallets[$key]["BALANCE"] . " " . $wallets[$key]["C_SYMBOL"];?>	
		</td>
	</tr>	
	<?php endforeach;?>
	</tbody>
</table>

<p>
	To add a wallet, 
	<?php echo "<a id='add_wallet' href='#'>click here</a>.";?> 
	Adding a new wallet is like opening an additional sub-account, for example, to maintain separate accounting of income from another business, etc.
</p>

<p>
	<?php echo anchor("user/account/profile", "Return to profile page");?> 
</p>


<div id="addWallet" title="Create new wallet" style="display:none;" style="height: 230px; min-height: 100px; width: auto;" class="ui-dialog-content ui-widget-content">
	<div style="border:none;" class="form">
		<div id="errorDescription"></div>
		<form id="addWalletForm" method='post' action="<?php echo site_url("user/account/profile/wallets/add")?>"  onsubmit="return Send('#addWalletForm');">
			<div class="line error-input">
				<label id="Description" for="txtDescription">Title</label>
				<input type="text" class="text" id="txtDescription" name="txtDescription">
			</div>
			<div class="line">
				<label id="Currencies" for="ddlCurrencies">Select Currency</label>
				<select id="ddlCurrencies" name="ddlCurrencies">
				<?php foreach ($av_currencies as $val):?>
					<option value="<?php echo $val['ID']?>"><?php echo $val['C_SYMBOL'];?></option>
				<?php endforeach;?>
				</select>
			</div>
			<div style='clear:both;'></div>
			<fieldset class="submit">
				<div class="input-button-block">
					<input type="submit" id="btnAddWallet" onclick="" value="Add" name="btnAddWallet">
				</div>
			</fieldset>
		</form>
	</div>
	<div id='loader' style='display:none;'>
		<img src='<?php echo base_url()?>public/images/loading.gif' alt='Loading...' />
	</div>
</div>
